/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.fzhucc.modules.expert.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yyg
* @date 2022-11-15
**/
@Entity
@Data
@Table(name="tt_expert")
public class Expert implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`username`")
    @ApiModelProperty(value = "登录账号")
    private String username;

    @Column(name = "`realname`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "真实姓名")
    private String realname;

    @Column(name = "`avatar`")
    @ApiModelProperty(value = "头像")
    private String avatar;

    @Column(name = "`phone`")
    @ApiModelProperty(value = "手机号码")
    private String phone;

    @Column(name = "`email`")
    @ApiModelProperty(value = "电子邮箱")
    private String email;

    @Column(name = "`is_show`")
    @ApiModelProperty(value = "是否小程序展示")
    private Integer isShow;

    @Column(name = "`is_academician`")
    @ApiModelProperty(value = "是否院士")
    private Integer isAcademician;

    @Column(name = "`user_intro`")
    @ApiModelProperty(value = "用户简介")
    private String userIntro;

    @Column(name = "`birthday`")
    @ApiModelProperty(value = "出生日期")
    private Timestamp birthday;

    @Column(name = "`major`")
    @ApiModelProperty(value = "专业")
    private String major;

    @Column(name = "`hospital`")
    @ApiModelProperty(value = "所在院")
    private String hospital;

    @Column(name = "`unit`")
    @ApiModelProperty(value = "单位")
    private String unit;

    @Column(name = "`post_str`")
    @ApiModelProperty(value = "职务")
    private String postStr;

    @Column(name = "`remarks`")
    @ApiModelProperty(value = "备注")
    private String remarks;

    @Column(name = "`type`")
    @ApiModelProperty(value = "专家类型")
    private String type;


    @Column(name = "`create_user_id`")
    @ApiModelProperty(value = "创建者user_id")
    private Long createUserId;


    @Column(name = "`source`")
    @ApiModelProperty(value = "来源")
    private String source;


    @Column(name = "`user_id`", unique = true)
    @ApiModelProperty(value = "user_id")
    private Long userId;

    @Column(name = "`is_delete`")
    @ApiModelProperty(value = "是否假删除")
    private Integer isDelete;

    @Column(name = "`sort`")
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @Column(name = "`coaching_enterprises`")
    @ApiModelProperty(value = "辅导企业情况")
    private String coachingEnterprises;

    @Column(name = "`is_push`")
    @ApiModelProperty(value = "是否推送")
    private Integer isPush;

    @Column(name = "`rexpertid`")
    @ApiModelProperty(value = "大赛专家id")
    private String rexpertid;

    @Column(name = "`is_pull`")
    @ApiModelProperty(value = "是否下发 1表示从大赛下拉的导师数据")
    private Integer isPull;

    @Column(name = "`sci_status`")
    @ApiModelProperty(value = "大赛账号状态 1解冻 2冻结 下发操作时参数使用")
    private Integer sciStatus;

    @Column(name = "`plate`")
    @ApiModelProperty(value = "所属平台")
    private String plate;

    @Column(name = "`xf`")
    @ApiModelProperty(value = "下发平台")
    private String xf;

    @ApiModelProperty(value = "地区划分 即什么地区看的到什么地区的数据,省的看到全部")
    @Column(name = "`org_area`",nullable = false)
    @NotNull
    public String orgArea;

    public void copy(Expert source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
